package com.longnuoqi.mydoctor.utils;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

/**
 * Created by Lenovo on 2016/1/13.
 */
public class EncodeDecodeUtil {

    public static String encoderUtf8(String s) {
        try {
            String result = URLEncoder.encode(s, "utf-8");
            return result;
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;

    } public static String decoderUtf8(String s) {
        try {
            String result = URLDecoder.decode(s, "utf-8");
            return result;
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }
}
